package com.itheima.tliasmanagent.filter;

import jakarta.servlet.*;
import jakarta.servlet.annotation.WebFilter;

import java.io.IOException;

//@WebFilter(urlPatterns = "/login")
public class AFilter  implements Filter {
    @Override
    public void init(FilterConfig filterConfig) throws ServletException {
        System.out.println(" Filter init 方法");
    }

    @Override
    public void doFilter(ServletRequest servletRequest, ServletResponse servletResponse, FilterChain filterChain) throws IOException, ServletException {
        // 拦截方法
        System.out.println(" doFilter 拦截方法 ");
        System.out.println(" 放行前逻辑 ");
       // filterChain.doFilter(servletRequest,servletResponse);
      //  System.out.println(" 放行后逻辑 ");

    }

    @Override
    public void destroy() {
        System.out.println(" Filter destory 方法");
    }
}
